import React, { Component } from 'react';
import '../css/ZuzhiDetailComponent.less';
import {observer} from "mobx-react";
import Mobx from '../mobx'
@observer class ZuzhiDetailComponent extends Component {
   constructor(props){
       super(props)
   }
    toZuzhi(item){
        console.log(item);
        if(item.auth.rtype==2){
            Mobx.history.push('/Work/'+1+'/'+item.auth.id)
        }else if(item.auth.rtype=='3'){
            Mobx.history.push('/Work/'+2+'/'+item.auth.id)
        }
    }
    render() {
        return (
            <ul className="ZuzhiDetailComponent">
                {
                    this.props.items.map((item,index)=>{
                        return(
                            <li key={index} onClick={this.toZuzhi.bind(this,item)}>
                                <div className='left'>
                                    <img src={item.auth.raddress} alt=""/>
                                </div>
                                <div className='right'>
                                    <p>{item.auth.rintroduction}</p>
                                </div>
                            </li>
                        )
                    })
                }
            </ul>
        );
    }
}

export default ZuzhiDetailComponent;
